<?php
/**
 * SwordMouse CMS 
 * $Id: include.php 6 2010-08-02 18:56:05Z dan@inkping.com $
 * @package Settings
 */

/* SETTINGS */

/**
 * Database connection settings
 */

define("TYPE", "");
define("HOST", "");
define("PORT", "");
define("BASE", "");
define("CHAR", "");
define("USER", "");
define("PASS", "");

/* FUNCTIONS */

/**
 * php __autoloader function for autoloading class files as required
 * @param $className - name of class to be autoloaded (E.g. PAGE)
 */ 
function __autoload($className) {
	require_once SITE::getSetting('classdir').$className.'.php';
}

/**
 * Security measure to prevent uncaught exceptions from displaying sensitive
 * application information to client user agent.
 * @param $exception - exception to be caught
 * @return void
 */
function exception_handler($exception) {
  	header("Location: ".SITE::getUrl('URL', 'errorsdir')."exception.php");
	exit();
}
set_exception_handler('exception_handler');

//TODO investigate need for these lines
//throw new Exception('Uncaught Exception');
//echo "Not Executed\n";

/**
 * Define default database connection string, run startScript and start user session
 */
SITE::startScript();
//TODO only if logged in as user or admin!
//TODO can't this go in an object somewhere??
//$userSession = new my_session($_MYSESSION_CONF);
?>